import { createRouter, createWebHistory } from 'vue-router'
import type { RouteRecordRaw } from 'vue-router'

import Home from '@/views/Home.vue'
import CreatorCenter from '@/views/CreatorCenter.vue'
import Admin from '@/views/Admin.vue'
import ArticleDetail from '@/views/ArticleDetail.vue'  

const routes: RouteRecordRaw[] = [
  { path: '/', name: 'Home', component: Home },
  { path: '/creator', name: 'CreatorCenter', component: CreatorCenter },
  { path: '/admin', name: 'Admin', component: Admin },
  { path: '/article/:id', name: 'ArticleDetail', component: ArticleDetail, props: true }, 
]

const router = createRouter({
  history: createWebHistory(),
  routes,
})

export default router
